package com.mybatis.core;

import java.lang.reflect.Proxy;

/**
 * @author yangjian
 */
public class DefaultSqlSession implements SqlSession {
  @Override
  public <T> T getMapper(Class<T> mapperInterface)
  {
    // 创建 Mapper 代理对象
    return (T) Proxy.newProxyInstance(DefaultSqlSession.class.getClassLoader(), new Class[]{mapperInterface}, new MapperProxyFactory());
  }
}
